package com.ruoyi.project.lely.bean.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotEmpty;
import org.hibernate.validator.constraints.Length;

/**
 * 专题
 *
 * @author luoyong
 */
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName(value = "`ly_topic`", autoResultMap = true)
public class LyTopic {


    @ApiModelProperty("ID")
    @TableId("id")
    private Long id;


    @Length(max = 255, message = "专题标题长度不能超过255位")
    @NotEmpty
    @ApiModelProperty("专题标题")
    @TableField(value = "`title`")
    private String title;


    @Length(max = 255, message = "专题子标题长度不能超过255位")
    @ApiModelProperty("专题子标题")
    @TableField(value = "`subtitle`")
    private String subtitle;


    @Length(max = 65535, message = "专题内容，富文本格式长度不能超过65535位")
    @ApiModelProperty("专题内容，富文本格式")
    @TableField(value = "`content`")
    private String content;


    @Digits(integer = 10 - 2, fraction = 2)
    @ApiModelProperty("专题相关商品最低价")
    @TableField(value = "`price`")
    private BigDecimal price;


    @Length(max = 255, message = "专题阅读量长度不能超过255位")
    @ApiModelProperty("专题阅读量")
    @TableField(value = "`read_count`")
    private String readCount;


    @Length(max = 255, message = "专题图片长度不能超过255位")
    @ApiModelProperty("专题图片")
    @TableField(value = "`pic_url`")
    private String picUrl;


    @ApiModelProperty("排序")
    @TableField(value = "`sort_order`")
    private Integer sortOrder;


    @Length(max = 2048, message = "专题相关商品序列码，用逗号分隔长度不能超过2048位")
    @ApiModelProperty("专题相关商品序列码，用逗号分隔")
    @TableField(value = "`goods`")
    private String goods;


    @ApiModelProperty("创建时间")
    @TableField(value = "`create_time`", fill = FieldFill.INSERT)
    private LocalDateTime createTime;


    @ApiModelProperty("更新时间")
    @TableField(value = "`update_time`", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


    @Length(max = 255, message = "活动分享二维码图片长度不能超过255位")
    @ApiModelProperty("活动分享二维码图片")
    @TableField(value = "`share_url`")
    private String shareUrl;


    @ApiModelProperty("逻辑删除")
    @TableField(value = "`deleted`", fill = FieldFill.INSERT)
    private Integer deleted;

}
